#ifndef DICOMIMAGELABEL_H
#define DICOMIMAGELABEL_H

#include <QLabel>
#include <QMap>
#include "../Global/commondefs.h"
class ImageInstance;
class SeriesInstance;

class DicomImageLabel : public QLabel
{
    Q_OBJECT
public:
    explicit DicomImageLabel(SeriesInstance *seriesPtr, QWidget *parent = 0);
    ~DicomImageLabel();

    QSize sizeHint() const { return QSize(IMAGE_LABEL_SIZE, IMAGE_LABEL_SIZE); }
    static int getImageLabelSize() { return IMAGE_LABEL_SIZE; }
    SeriesInstance *getSeriesInstance() const { return series; }
    bool hasImage(const QString &file) const;

signals:
    void imageClicked(DicomImageLabel *label);
    void imageDoubleClicked(DicomImageLabel *label);

public slots:
    bool insertImage(ImageInstance *image);
    bool removeImage(const QString &imgFile);
    void setHighlight(bool yes);
    void updateThumbnailImage();

protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseDoubleClickEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);

private:
    SeriesInstance *series;
    QLabel *nameLabel;
    QLabel *frameLabel;

    QPoint dragOrg;
};

#endif // DICOMIMAGELABEL_H
